import http from "../http";
export async function getGoodsDetail(id) {
    let {
        data
    } = await http({
        url: `goods?id=${id}`
    })
    return data
}
export async function getGoodsRelevant(params) {
    let {
        data
    } = await http({
        url: `goods/relevant?id=${params.id}&limit=${params.limit}`
    })
    return data
} /* 获取商品详情页的热销榜数据 */
export async function getGoodsHot(params) {
    let {
        data
    } = await http({
        url: `goods/hot?id=${params.id}&limit=${params.limit}&type=${params.type}`
    })
    return data
}
/* 或取商品评价 */
export async function getGoodsComment(id) {
    let {
        data
    } = await http({
        url: `https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`
    })
    return data
}
/* 获取用户评论 */
export async function getUserCommentsData(params) {
    if (params.hasPicture) {
        let {
            data
        } = await http({
            url: `https://mock.boxuegu.com/mock/1175/goods/${params.id}/evaluate/page?page=${params.page}&pageSize=${params.pageSize}&hasPicture=${params.hasPicture}`
        })
        return data
    } else if (params.tag) {
        let {
            data
        } = await http({
            url: `https://mock.boxuegu.com/mock/1175/goods/${params.id}/evaluate/page?page=${params.page}&pageSize=${params.pageSize}&tag=${params.tag}`
        })
        return data
    } else {
        let {
            data
        } = await http({
            url: `https://mock.boxuegu.com/mock/1175/goods/${params.id}/evaluate/page?page=${params.page}&pageSize=${params.pageSize}`
        })
        return data
    }

}